<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<s:head theme="ajax"/>
</head>
<body>
<table border="0" width="500">	
	<caption><font size="4">&nbsp;</font></caption>
	<tr>		
		<th width="15%">용도</th>
		<th width="30%">분류명</th>
		<th width="35%">비고</th>
		<th width="20" colspan="2" align="center">
			<input type="button" value="새분류 등록" onclick="javascript:foldInsert()">
		</th>		
	</tr>
	<tr>
		<td colspan="5">
			<hr color="#4a76b6" noshade="noshade">
		</td>
	</tr>
	<s:iterator value="calist">
	<tr id="list${cno }" onmouseover="this.style.backgroundColor='#eaf0fa'"  onmouseout="this.style.backgroundColor=''">
		<td align="center" width="10%">
			<select name="type" disabled="disabled">				
				<option value="1" ${type==1?" selected":"" }>개인</option>
				<option value="2" ${type==2?" selected":"" }>부서</option>
			</select>
		</td>
		<td width="35%">${cname }</td>
		<td width="35%">${description }</td>
		<td align="center" width="10%">			
			<a href="javascript:foldTR(${cno })">					
				<img src="/ssteam/image/addrbook/category_button_modify.png" border="0" align="middle">
			</a>
		</td>
		<td align="center" width="10%">
			<s:url id="caDelURL" action="c_delete" namespace="/addrbook">
				<s:param name="cno">${cno }</s:param>
				<s:param name="abcase" value="1"/>					
			</s:url>			
		 	<s:a href="%{caDelURL}" theme="ajax" targets="center">
		 		<img src="/ssteam/image/addrbook/category_button_delete.png" border="0">
		 	</s:a>
		</td>
	</tr>
	<%--수정창 --%>
	<tr id="edit${cno }" style="display: none;">
		<td colspan="5">
			<form id="cufrm${cno }" action="/ssteam/addrbook/c_update.team" method="post">
			<select name="type">				
				<option value="1" ${type==1?" selected":"" }>개인</option>
				<option value="2" ${type==2?" selected":"" }>부서</option>
			</select>
			&nbsp;
			<input type="text" name="cname" value="${cname }" size="20">
			<input type="text" name="description" value="${description }" size="20">
			<input type="hidden" name="cno" value="${cno }">									
			<input type="hidden" name="abcase" value="1">					
			<s:a formId="cufrm%{#request.cno }" theme="ajax" targets="center" showLoadingText="false">
				<img src="/ssteam/image/addrbook/ab_butt_save.png" border="0" align="middle"></s:a>
			<a href="#" onclick="javascript:foldTR(${cno }); false;">
				<img src="/ssteam/image/addrbook/ab_butt_cancel.png" border="0" align="middle"></a>					
			</form>				
		</td>					
	</tr>	
	</s:iterator>				
	<tr id="insert" style="display:none ;">
		<td colspan="5">
		 <form id="cifrm" action="/ssteam/addrbook/c_insert.team" method="post">
		<%--분류 신규 등록용 폼. 기본으로 안보임 --%>
			<select name="type">				
				<option value="1">개인</option>
				<option value="2">부서</option>
			</select>&nbsp;&nbsp;		 		 	 
			<input type="text" id="cname" name="cname" size="16">&nbsp;&nbsp;			
			<input type="text" id="description" name="description" size="19">&nbsp;&nbsp;
			<input type="hidden" name="abcase" value="1">&nbsp;&nbsp;
		 <s:a formId="cifrm" theme="ajax" targets="center" showLoadingText="false">
		 	<img src="/ssteam/image/addrbook/category_button_insert.png" border="0" align="middle">
		 </s:a>
		 </form>
		</td>				
	</tr>									
</table>		
</body>
</html>